package com.jack.reactor;

import reactor.core.publisher.Mono;

import java.util.Optional;

/**
 * 测试Mono的使用
 * Created by zhang_j on 2019/10/23
 */
public class MonoTest {

    public static void main(String[] args) {
        monoCreateTest();
    }

    public static void monoCreateTest(){
        Mono.fromSupplier(()->"Hello").subscribe(System.out::println);

        Mono.justOrEmpty(Optional.of("Hello")).subscribe(System.out::println);

        Mono.create(sink->sink.success("Hello")).subscribe(System.out::println);
    }
}
